<?php
/**
* @package YaForms
* @copyright Авторские права (C) 2009 www.yar-it.com. Все права защищены.
* @license Лицензия http://www.gnu.org/licenses/gpl-2.0.htm GNU/GPL, или help/license.php
* YaForms! - свободное программное обеспечение распространяемое по условиям лицензии GNU/GPL
* Для получения информации о используемых расширениях и замечаний об авторском праве, смотрите файл copyright.php.
*/

defined( '_VALID_MOS' ) or die( 'Restricted access' );

require(JPATH_BASE.'/administrator/components/com_yaforms/lib/af.lib.core.php');

class HTML_yaforms {

   function showArtformsPanel() {

      global $YaForms_version;
      ?>

<table class="adminheading">
  <tbody>
    <tr>
      <th class="config"><?php echo YAF_MENU_FORMS; ?></th>
    </tr>
  </tbody>
</table>
<table width="100%">
  <tr>
    <td width="60%"><div class="cpicons" style="border: 1px solid #CCCCCC;margin-right: 10px;">
        <?php
         afPanelButton( 'showaf', 'components/com_yaforms/images/forms48.png', YAF_MENU_FORMS );
         afPanelButton( 'rforms', 'components/com_yaforms/images/rforms48.png', YAF_MENU_RFORMS );
		 afPanelButton( 'config&amp;hidemainmenu=1', 'templates/joostfree/images/cpanel_ico/config.png', YAF_MENU_CONFIG );
         afPanelButton( 'language', 'components/com_yaforms/images/lang48.png', YAF_MENU_LANG );
         afPanelButton( 'cssedit', 'components/com_yaforms/images/css48.png', YAF_MENU_CSS );
         afPanelButton( 'update', 'components/com_yaforms/images/update48.png', YAF_MENU_UPDATE );
		 afPanelButton( 'help', 'components/com_yaforms/images/help48.png', YAF_MENU_HELP );
         afPanelButton( 'info', 'components/com_yaforms/images/info48.png', YAF_MENU_INFO );
      ?>
      </div></td>
    <td width="40%" valign="top">Поблагодарить автора:<br />
      <form id=pay name=pay method="POST" action="https://merchant.webmoney.ru/lmi/payment.asp">
        <input name="LMI_PAYMENT_AMOUNT" type="text" size="3" value="1">
        <input type="hidden" name="LMI_PAYMENT_DESC" value="Blagodarnost avtoru">
        <input type="hidden" name="LMI_SIM_MODE" value="0">
        <input type="hidden" name="LMI_SUCCESS_URL" value="http://yar-it.com/">
        <input type="hidden" name="LMI_SUCCESS_METHOD" value="2">
        <input type="hidden" name="LMI_FAIL_URL" value="http://yar-it.com/">
        <input type="hidden" name="LMI_FAIL_METHOD" value="2">
        <select name="LMI_PAYEE_PURSE" style="min-width:30px;">
          <option value="Z222701768194">WMZ</option>
          <option value="E974972909428">WME</option>
          <option value="R332765512780">WMR</option>
        </select>
        <input type="submit" class="button" value="Отправить">
      </form>
      <br />
      <table width="100%" border="0" class="adminform" cellspacing="0" cellpadding="0">
        <tr>
          <th colspan="2"></th>
        </tr>
        <tr>
          <td><?php echo YAF_CRED_VER; ?></td>
          <td><?php  echo afVersionYar(); ?></td>
        </tr>
        <tr>
          <td><?php echo YAF_CRED_BETATESTERS; ?>
            <input type="hidden" name="LMI_PAYMENT_NO" value="1" /></td>
          <td><?php echo afFooter(); ?></td>
        </tr>
      </table></td>
  </tr>
</table>
<?php
echo afLoadTitleError();
   }


   function showLanguage() {

          global $option, $database, $mosConfig_lang;

          if (file_exists(JPATH_BASE.'/components/com_yaforms/language/'.$mosConfig_lang.'.php')) {
             $fname = JPATH_BASE.'/components/com_yaforms/language/'.$mosConfig_lang.'.php';
          } else {
             $fname = JPATH_BASE.'/components/com_yaforms/language/russian.php';
          }

          afLoadSectionTitle( YAF_MENU_LANG, 'lang48' );
          ?>
<form action="index2.php" method="post" name="adminForm" class="adminform" id="adminForm">
<table cellpadding="1" cellspacing="1" border="0" width="100%">
  <tr>
    <td width="270"><span class="componentheading"><?php echo $mosConfig_lang;?>.php: <?php echo is_writable( $fname ) ? '<b><font color="green"> '.YAF_MULTI_WRITABLE.'</font></b>' : '<b><font color="red"> '.YAF_MULTI_UNWRITABLE.'</font></b>' ?> </span> </td>
    <?php
			if (mosIsChmodable($fname)) {
				if (is_writable($fname)) {
					?>
    <td><input type="checkbox" id="disable_write" name="disable_write" value="1"/>
      <label for="disable_write"><?php echo YAF_MULTI_ENAWRITEFILE; ?></label>
    </td>
    <?php
				} else {
					?>
    <td><input type="checkbox" id="enable_write" name="enable_write" value="1"/>
      <label for="enable_write"><?php echo YAF_MULTI_DISAWRITEFILE; ?></label>
    </td>
    <?php
				}
			}
			?>
  </tr>
</table>
<?php
	  $f=fopen($fname,"r");
	  $fcontent = fread($f, filesize($fname));
	  $fcontent = htmlspecialchars($fcontent);
	  ?>
<table  border="0" width="100%" class="adminform">
  <tr>
    <th colspan="2"> <?php echo YAF_MULTI_PATH; ?>: <?php echo $fname; ?> </th>
  </tr>
  <tr>
    <td><input type="hidden" name="fname" value="<?php echo $fname; ?>" />
      <textarea cols="90" rows="20" name="fcontent2"><?php echo $fcontent; ?></textarea>
      <input type="hidden" name="option" value="<?php echo $option; ?>">
      <input type="hidden" name="task" value="language">
      <input type="hidden" name="boxchecked" value="0">
    </td>
  </tr>
  <tr>
    <td colspan="2"><?php echo YAF_MULTI_FILENEEDPERM; ?></td>
  </tr>
</table>
<?php
      
        
   }
        

   function showCSS() {

        global $option, $database, $mosConfig_lang;

          $fname = JPATH_BASE.'/components/com_yaforms/css/yaforms.css';

          afLoadSectionTitle( YAF_MENU_CSS, 'css48' );
          ?>
<form action="index2.php" method="post" name="adminForm" class="adminform" id="adminForm">
<table cellpadding="1" cellspacing="1" border="0" width="100%">
  <tr>
    <td width="270"><span class="componentheading">yaforms.css: <?php echo is_writable( $fname ) ? '<b><font color="green"> '.YAF_MULTI_WRITABLE.'</font></b>' : '<b><font color="red"> '.YAF_MULTI_UNWRITABLE.'</font></b>' ?> </span> </td>
    <?php
			if (mosIsChmodable($fname)) {
				if (is_writable($fname)) {
					?>
    <td><input type="checkbox" id="disable_write" name="disable_write" value="1"/>
      <label for="disable_write"><?php echo YAF_MULTI_ENAWRITEFILE; ?></label>
    </td>
    <?php
				} else {
					?>
    <td><input type="checkbox" id="enable_write" name="enable_write" value="1"/>
      <label for="enable_write"><?php echo YAF_MULTI_DISAWRITEFILE; ?></label>
    </td>
    <?php
				}
			}
			?>
  </tr>
</table>
<?php

	  $f=fopen($fname,"r");
	  $fcontent = fread($f, filesize($fname));
	  $fcontent = htmlspecialchars($fcontent);
	  ?>
<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminform">
  <tr>
    <th colspan="2"><?php echo YAF_MULTI_PATH; ?>: <?php echo $fname; ?>
      </td>
  </tr>
  <tr>
    <td><input type="hidden" name="fname" value="<?php echo $fname; ?>" />
      <textarea cols="90" rows="20" name="fcontent"><?php echo $fcontent; ?></textarea>
      <input type="hidden" name="option" value="<?php echo $option; ?>">
      <input type="hidden" name="task" value="cssedit">
      <input type="hidden" name="boxchecked" value="0">
    </td>
    <td></td>
  </tr>
  <tr>
    <td colspan="2"><?php echo YAF_MULTI_FILENEEDPERM; ?></td>
  </tr>
</table>
<?php
         
          
   }

        
   function showUpdate() {
        
      global $database, $option, $mosConfig_lang;

      if ( mosGetParam( $_GET, 'no_afhtml' ) != '1' ) afLoadSectionTitle( YAF_MENU_UPDATE, 'update48' );
      afLoadLib( 'bkup' );
      $file	= mosGetParam( $_POST, "file", null );
      $upfile	= mosGetParam($_FILES,"upfile",null);
      $tables = mosGetParam( $_POST, "tables", null );
      $OutType = mosGetParam( $_POST, "OutType", null );
      $OutDest = mosGetParam( $_POST, "OutDest", null );
      $toBackUp = mosGetParam( $_POST, "toBackUp", null );
      require( JPATH_BASE.'/administrator/components/com_yaforms/config.yaforms.php' );
      if( $afcfg_bkup_path != '' && is_dir(JPATH_BASE.$afcfg_bkup_path) ){
         $afbkup_path = JPATH_BASE.$afcfg_bkup_path;
      } else {
         $afbkup_path = JPATH_BASE.'/administrator/components/com_yaforms/backups/';
      }
      $dotask = mosGetParam( $_GET, 'dotask' );
      if ( mosGetParam( $_GET, 'no_afhtml' ) != '1' ) {
      ?>
<div id="updpanel">
  <div align="center">
    <?php afUpdBnt( $option, 'dbbackup', YAF_BKUP_MAKEDBBACKUP, 'update', YAF_BKUP_DOBACKUP );?>
  </div>
  <div align="center">
    <!--  <textarea cols="90" rows="20" name="fcontent"><?php echo $fcontent; ?></textarea>-->
    <?php afUpdBnt( $option, 'dbrestore', YAF_BKUP_MAKEDBRESTORE, 'update', YAF_BKUP_DORESTORE );?>
  </div>
</div>
<div class="clear"></div>
<div align="center">
  <?php
      }

      switch ($dotask) {
        case 'afupd21b5':
                afLoadAFUpdate( '15', 'afupd21b5' );
		break;
	case 'afupd21b6':
                afLoadAFUpdate( '35', 'afupd21b6' );
		break;
	case 'afupd21b7':
                afLoadAFUpdate( '7', 'afupd21b7' );
		break;
	case 'dbbackup':
		dbBackup( $option);
		break;
	case 'dobackup':
		doBackup( $tables,$OutType,$OutDest,$toBackUp,$_SERVER['HTTP_USER_AGENT'], $afbkup_path);
		break;
	case 'dbrestore':
		dbRestore( $afbkup_path);
		break;
	case 'dorestore':
		doRestore( $file,$upfile,$afbkup_path);
		break;
      }

      ?>
</div>
<?php
     
        
   }

        
   function showRForms( &$rows, $search, &$pageNav, $option ) {

           global $option, $mainframe;
           afLoadHSJS();
           afLoadSectionTitle( YAF_MENU_RFORMS, 'rforms48' );
           ?>
<form action="index2.php" method="post" name="adminForm">
  <table class="adminheading" border="0" cellpadding="3" cellspacing="0" width="100%">
    <tr>
      <td align="right"><?php echo YAF_MULTI_SEARCHTITLE ?>:
        <input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" />
      </td>
    </tr>
  </table>
  <table width="100%" border="0" cellpadding="4" cellspacing="0" class="adminlist">
    <tr>
      <th width="20">#</th>
      <th width="20"> <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" />
      </th>
      <th width="120" align="center"> <?php echo YAF_RFORMS_DATE; ?> </th>
      <th width="20" align="center"> <?php echo YAF_RFORMS_PREVIEW; ?> </th>
      <th align="left"> <?php echo YAF_RFORMS_FORMTITLE; ?> </th>
      <th align="left"> <?php echo YAF_RFORMS_JUSER; ?> </th>
      <th align="left"> IP </th>
      <th align="left"> <?php echo YAF_RFORMS_FIRSTFIELD; ?> </th>
      <th align="left"> <?php echo YAF_RFORMS_SECONDFIELD; ?> </th>
      <th align="left"> <?php echo YAF_RFORMS_EMAIL; ?> </th>
    </tr>
    <?php
		 $k = 0;
                 for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = $rows[$i];
                        $link = 'index2.php?option=com_yaforms&task=vrforms&id='.$row->id;
                        $checked = mosHTML::idBox( $i, $row->id );
                        $item_name = explode(";", $row->item_name);
                        $item_data = explode(";", $row->item_data);
                        ?>
    <tr class="<?php echo "row$k"; ?>">
      <td align="center"><?php echo $pageNav->rowNumber( $i ); ?> </td>
      <td align="center"><?php echo $checked; ?> </td>
      <td width="120" align="center"><?php echo $row->form_date; ?> </td>
      <td width="20" align="center"><?php echo "<a href=\"".$link."&no_html=1&no_affoo=1&afjcss=1\" onclick=\"return hs.htmlExpand(this, { contentId: 'highslide-html', objectType: 'iframe', objectWidth: 700, objectHeight: 900} )\" class=\"highslide\">
                           <img src=\"".JPATH_SITE."/includes/js/ThemeOffice/preview.png\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"".YAF_RFORMS_PREVIEW."\"/>
                           </a>";?> </td>
      <td align="left"><a href="<?php echo $link; ?>"><?php echo $row->title; ?></a> </td>
      <td align="left"><?php echo $item_data[array_search('ARTFJUSER', $item_name)];?> </td>
      <td align="left"><?php echo $item_data[array_search('ARTFJUSERIP', $item_name)];?> </td>
      <td align="left"><?php echo strip_tags($item_data[0]);?> </td>
      <td align="left"><?php
                        if( isset( $item_data[1] ) ) echo strip_tags($item_data[1]);?>
      </td>
      <td align="left"><?php
                       foreach ($item_data as $itd){
                        if (strrchr($itd, '@')){
                           $item_email = array();
                           for ($j=0;$j < count($item_data); $j++ ){
	                      $item_email[$j] = $itd;
                           }
                           echo $item_email[0];
                        }
                       }
                        ?>
      </td>
    </tr>
    <?php
		 $k = 1 - $k;
		 }
                 ?>
  </table>
  <?php echo $pageNav->getListFooter(); ?>
  <input type="hidden" name="option" value="<?php echo $option; ?>" />
  <input type="hidden" name="task" value="" />
  <input type="hidden" name="subtask" value="rforms" />
  <input type="hidden" name="boxchecked" value="0" />
</form>
<?php
              afLoadHSDivs();
            
              
   }


   function showViewRForms( &$rows, $option ) {

         require( JPATH_BASE.'/administrator/components/com_yaforms/config.yaforms.php' );
         afLoadLib ( 'attfiles' );
         $row = $rows[0];

         $subtask = mosGetParam( $_GET, 'subtask' );
         switch ( $subtask ) {
          case 'dattach':

              $nfile = mosGetParam( $_GET, 'dattachfile' );
              afDLFileFromRForms ( $nfile );

          break;
          
          default:
          
           $item_name = explode(";", $row->item_name);
           $item_data = explode(";", $row->item_data);

           if( mosGetParam( $_GET, 'afjcss' ) == '1' ){
              afLoadVRAdmCSS();
           }

           afLoadSectionTitle( YAF_MENU_RFORMS, 'rforms48' );
           ?>
<table width="100%" border="0" cellpadding="4" cellspacing="4" class="adminlist">
<tr>
  <th colspan="2"><?php echo YAF_RFORMS_FORMTITLE.': '.$row->title; ?></th>
</tr>
<tr>
  <td colspan="2" align="right"><?php echo $row->form_date; ?></td>
</tr>
<?php
                    for($i=0; $i < count( $item_name ); $i++) {

                       if ( $item_name[$i] == 'ARTFJUSER' ){
                           echo '<tr>
			           <td align="right"><strong>'.YAF_JUSER.':</strong></td>
			           <td align="left">'.$item_data[$i].'</td>
		                </tr>';
                       } elseif ( $item_name[$i] == 'ARTFJUSERNAME' ){
                           echo '<tr>
			           <td align="right"><strong>'.YAF_JUSERNAME.':</strong></td>
			           <td align="left">'.$item_data[$i].'</td>
		                </tr>';
                       } elseif ( $item_name[$i] == 'ARTFJUSERIP' ){
                           echo '<tr>
			           <td align="right"><strong>'.YAF_JUSERIP.':</strong></td>
			           <td align="left">'.$item_data[$i].'</td>
		                </tr>';
		       } elseif ( $item_name[$i] == 'ARTFNLYES' ){
                           echo '<tr>
			           <td align="right"><strong>'.YAF_RFORMS_USERSUBSCNL.':</strong></td>
			           <td align="left">'.$item_data[$i].'</td>
		                </tr>';
		       } elseif ( $item_name[$i] == 'ARTFATTACHFILE' && $item_data[$i] == '' ){
		       
		       
                       } elseif ( $item_name[$i] == 'ARTFATTACHFILE' && $item_data[$i] != '' ){
					   
                          $dlink = JPATH_SITE . $afcfg_att_path;
                          $dattachfiles = explode('|', $item_data[$i]);

                          if( $afcfg_att_path != '' && is_dir(JPATH_BASE . $afcfg_att_path) ){
                             $dattachfilepath = JPATH_BASE . $afcfg_att_path;
                          } else {
                             $dattachfilepath = JPATH_BASE . $afcfg_att_path;
                          }

                          foreach($dattachfiles as $dattachfile){
                             echo '<tr>
			              <td align="right">
                                         <strong>'.YAF_ATTACHFILE.':</strong>
                                      </td>
			              <td align="left">
                                         <a href="'.$dlink . $dattachfile.'" target="_blank">'.$dattachfile.'</a> ( '.afGetFileSize( filesize( $dattachfilepath.$dattachfile ) ).' )
                                      </td>
		                   </tr>';
		          }
                       } else {

                          echo '<tr>
			           <td align="right"><strong>'.$item_name[$i].':</strong></td>
			           <td align="left">'.$item_data[$i].'</td>
		                </tr>';
                       }
		    }
                    echo '</table>';
       

          break;
          }
   }

        
   function showHelp($option){

           global $mosConfig_lang;

           afLoadSectionTitle( YAF_MENU_FORMS, 'forms48' );

           echo '<form action="index2.php" method="post" name="adminForm" class="adminform" id="adminForm">';
           if (file_exists(JPATH_BASE.'/administrator/components/com_yaforms/tutorial/tutorial.'.$mosConfig_lang.'.php')) {
              include(JPATH_BASE.'/administrator/components/com_yaforms/tutorial/tutorial.'.$mosConfig_lang.'.php');
           } else {
              include(JPATH_BASE.'/administrator/components/com_yaforms/tutorial/tutorial.english.php');
           }
           
           echo '<input type="hidden" name="option" value="'.$option.'">
          <input type="hidden" name="task" value=""></form>';
         

   }


   function showConfig() {

             global $database, $mainframe, $option;

             afLoadSectionTitle( YAF_MENU_CONFIG, 'config48' );

             require(JPATH_BASE. '/administrator/components/com_yaforms/config.yaforms.php');
             $fname = JPATH_BASE. '/administrator/components/com_yaforms/config.yaforms.php';

             $query = "SELECT a.id FROM #__components AS a WHERE a.option = 'com_yaforms' AND a.parent = '0'";
	     $database->setQuery( $query );
	     $compid = $database->loadResult();
             $row = new mosComponent( $database );
	     $row->load( $compid );
             $params = new mosParameters( $row->params, $mainframe->getPath( 'com_xml', $row->option ), 'component' );
             $rootfronttitle = $params->get( 'rootfronttitle' );
             $fronttext = urldecode( $params->get( 'fronttext' ) );
             if( get_magic_quotes_gpc()) {
                $fronttext = stripcslashes($fronttext);
             }
             ?>
<script type="text/javascript">
		function changeDisplayImage() {
                        var imgFile = document.adminForm.afcfg_asteriskimg.value;
                        var imgExt = (imgFile.substring(imgFile.lastIndexOf("."))).toLowerCase();
                        var container2 = document.getElementById('imagelib2');
                        var urlPath = '<?php echo JPATH_SITE;?>';

                        if (document.adminForm.afcfg_asteriskimg.value ==''){
                             var imgfunc = urlPath+'/images/yaforms/asterisks/ast01.png';
                        } else {
			     var imgfunc = urlPath+'/images/yaforms/asterisks/' + document.adminForm.afcfg_asteriskimg.value;
                        }
                        var bannerfilesource = '<img src="'+ imgfunc +'" name="imagelib" />';
			html = '';
                        html += (bannerfilesource);
                        container2.innerHTML = html;
		}
                function submitbutton(pressbutton) {
                   var form = document.adminForm;
                   if (pressbutton == 'cancel') {
                      submitform( pressbutton );
                      return;
                   } else {
                   <?php getEditorContents( 'fronttext', 'fronttext' ) ; ?>
                   submitform( pressbutton );
                   }
                }
             </script>
<form action="index2.php" method="post" name="adminForm" class="adminform" id="adminForm">
  <table cellpadding="1" cellspacing="1" border="0" width="100%">
    <tr>
      <td width="350"><span class="componentheading">config.yaforms.php: <?php echo is_writable( $fname ) ? '<b><font color="green"> '.YAF_MULTI_WRITABLE.'</font></b>' : '<b><font color="red"> '.YAF_MULTI_UNWRITABLE.'</font></b>' ?> </span> </td>
      <?php
			if (mosIsChmodable($fname)) {
				if (is_writable($fname)) {
					?>
      <td><input type="checkbox" id="disable_write" name="disable_write" value="1"/>
        <label for="disable_write"><?php echo YAF_MULTI_ENAWRITEFILE; ?></label>
      </td>
      <?php
				} else {
					?>
      <td><input type="checkbox" id="enable_write" name="enable_write" value="1"/>
        <label for="enable_write"><?php echo YAF_MULTI_DISAWRITEFILE; ?></label>
      </td>
      <?php
				}
			}
			?>
    </tr>
  </table>
  <?php
               $tabs = new mosTabs(1);
               $tabs->startPane( 'yaformscfg' );
               $tabs->startTab( YAF_CFG_CONFIGTAB, 'cfg1' );
               ?>
  <table width="100%" border="0" cellpadding="4" cellspacing="4" class="adminform">
    <th colspan="3" class="sectionname"> <div align="left" class="title"> <?php echo YAF_CFG_CONFIGTITLE; ?> </div></th>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_ASTERISKSPATH; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     $afcfg_asterisks_path = '/images/yaforms/asterisks/';
                     echo '<input type="text" size="60" name="afcfg_asterisks_path" value="'.$afcfg_asterisks_path.'" class="text_area" readonly="true">';
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_BKUPFILEPATH; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     if( $afcfg_bkup_path == '' )$afcfg_bkup_path = '/administrator/components/com_yaforms/backups/';
                     echo '<input type="text" size="60" name="afcfg_bkup_path" value="'.$afcfg_bkup_path.'" class="text_area">';
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_ATTFILEPATH; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     if( $afcfg_att_path == '' )$afcfg_att_path = '/images/yaforms/attachedfiles/';
                     echo '<input type="text" size="60" name="afcfg_att_path" value="'.$afcfg_att_path.'" class="text_area">';
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_ATTFILESAVE; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     $afcfg_attfilesavesel[] = mosHTML::makeOption( '0', YAF_MULTI_NO );
                     $afcfg_attfilesavesel[] = mosHTML::makeOption( '1', YAF_MULTI_YES );
                     $afcfg_attfilesaveview = mosHTML::selectList( $afcfg_attfilesavesel, 'afcfg_attfilesave', 'class="text_area" size="1"', 'value', 'text', $afcfg_attfilesave );
                     echo $afcfg_attfilesaveview;
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_ATTIMAGEW; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     echo '<input type="text" size="6" name="afcfg_attimagew" style="text-align:right;" class="text_area" value="'.$afcfg_attimagew.'"> px';
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_ATTIMAGEH; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     echo '<input type="text" size="6" name="afcfg_attimageh" style="text-align:right;" class="text_area" value="'.$afcfg_attimageh.'"> px';
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_DBSAVEFORMS; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     $afcfg_dbsaveformssel[] = mosHTML::makeOption( '0',YAF_MULTI_NO);
                     $afcfg_dbsaveformssel[] = mosHTML::makeOption( '1',YAF_MULTI_YES);
                     $afcfg_dbsaveformsview = mosHTML::selectList( $afcfg_dbsaveformssel, 'afcfg_dbsaveforms', 'class="text_area" size="1"', 'value', 'text', $afcfg_dbsaveforms );
                     echo $afcfg_dbsaveformsview;
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_ALLOWERRREP; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     $afcfg_allowerr_repsel[] = mosHTML::makeOption( '1',YAF_MULTI_YES);
                     $afcfg_allowerr_repsel[] = mosHTML::makeOption( '0',YAF_MULTI_NO);
                     $afcfg_allowerr_repview = mosHTML::selectList( $afcfg_allowerr_repsel, 'afcfg_allowerr_rep', 'class="text_area" size="1"', 'value', 'text', $afcfg_allowerr_rep );
                     echo $afcfg_allowerr_repview;
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_BEITEMSINTERF; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     $afcfg_beitemsinterfasesel[] = mosHTML::makeOption( 'ajax',YAF_CFG_BEITEMSINTERFNEW);
                     $afcfg_beitemsinterfasesel[] = mosHTML::makeOption( 'old',YAF_CFG_BEITEMSINTERFOLD);
                     $afcfg_beitemsinterfaseview = mosHTML::selectList( $afcfg_beitemsinterfasesel, 'afcfg_beitemsinterfase', 'class="text_area" size="1"', 'value', 'text', $afcfg_beitemsinterfase );
                     echo $afcfg_beitemsinterfaseview;
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_EDITDEFFIELDSLAYOUT; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     if( $afcfg_fieldsdefaultlayout == '' ){
                        $afcfg_fieldsdefaultlayout ='
<div class="yf_field">
<div class="yf_field_name">###FIELDNAME###</div>
<div class="yf_the_field">###THEFIELD###</div>
<div class="yf_aster">###ASTERISK###</div>
</div>
<div class="yf_clear"></div>';
                     } else {
                        $afcfg_fieldsdefaultlayout = urldecode( $afcfg_fieldsdefaultlayout );
                     }
                     ?>
        <textarea class="text_area" type="text" cols="74" rows="12" name="afcfg_fieldsdefaultlayout" />
        <?php echo $afcfg_fieldsdefaultlayout;?>
        </textarea>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
  </table>
  <?php
               $tabs->endTab();
               $tabs->startTab( YAF_CFG_FRONTTAB, 'cfg2' );
               ?>
  <table width="100%" border="0" cellpadding="4" cellspacing="4" class="adminform">
    <tr>
      <th colspan="3" class="sectionname"> <div align="left" class="title"> <?php echo YAF_CFG_FRONTTITLE; ?> </div></th>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_SHOWFRONTCSS; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     $afcfg_loadfrontcsssel[] = mosHTML::makeOption( '1', YAF_MULTI_YES );
                     $afcfg_loadfrontcsssel[] = mosHTML::makeOption( '0', YAF_MULTI_NO );
                     $afcfg_loadfrontcssview = mosHTML::selectList( $afcfg_loadfrontcsssel, 'afcfg_loadfrontcss', 'class="text_area" size="1"', 'value', 'text', $afcfg_loadfrontcss );
                     echo $afcfg_loadfrontcssview;
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong><?php echo YAF_CFG_ALLOWAJAX; ?></strong> </td>
      <td align="left" valign="top"><?php
                     $afcfg_allowajaxsel[] = mosHTML::makeOption( '0',YAF_MULTI_NO);
                     $afcfg_allowajaxsel[] = mosHTML::makeOption( '1',YAF_MULTI_YES);
                     $afcfg_allowajaxview = mosHTML::selectList( $afcfg_allowajaxsel, 'afcfg_allowajax', 'class="text_area" size="1"', 'value', 'text', $afcfg_allowajax );
                     echo $afcfg_allowajaxview;
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_ASTERISKIMGSEL; ?> </strong> </td>
      <td align="left" valign="top"><div id="cfgimgsel">
        <?php
                     $afcfg_asteriskimgview = array();
                     $javascript = 'onchange="changeDisplayImage();"';
	             $directory = '/images/yaforms/asterisks/';
	             $afcfg_asteriskimgview = mosAdminMenus::Images( 'afcfg_asteriskimg', $afcfg_asteriskimg, $javascript, $directory );
                     echo $afcfg_asteriskimgview.'</div>';

                     if($afcfg_asteriskimg != ''){

                         echo '<div id="imagelib2" align="left" width="100%">
                                  <script type="text/javascript">
                                     document.write(\'<img src="'.JPATH_SITE.'/images/yaforms/asterisks/'.$afcfg_asteriskimg.'" name="imagelib" />\');
                                  </script>
                               </div>
                               <script type="text/javascript">window.onload=changeDisplayImage();</script>';

                     } else {

                         echo'<div id="imagelib2" align="left" width="100%">
                              </div>';

                     }
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_ROOTFRONTTITLE; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     echo '<input type="text" size="60" name="rootfronttitle" class="text_area" value="'.$rootfronttitle.'">';
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_FRONTTEXT; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     editorArea( 'fronttext',  $fronttext, 'fronttext', '600', '230', '80', '10' ) ;
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
  </table>
  <?php
               $tabs->endTab();
               $tabs->startTab( YAF_CFG_VALIDETAB, 'cfg3' );
               ?>
  <table width="100%" border="0" cellpadding="4" cellspacing="4" class="adminform">
    <tr>
      <th colspan="3" class="sectionname"> <div align="left" class="title"> <?php echo YAF_CFG_VALIDETITLE; ?> </div></th>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_ZIPCODEVALIDATION; ?> </strong> </td>
      <td align="left" valign="top"><?php
	  				$afcfg_valide_zipcodesel[] = mosHTML::makeOption( '^[0-9]{6}$', '150045 (Russia)' );
                     $afcfg_valide_zipcodesel[] = mosHTML::makeOption( '^[0-9]{5}$|^[0-9]{5}-[0-9]{4}$', '33125 or 54321-6789 (USA)' );
                     $afcfg_valide_zipcodesel[] = mosHTML::makeOption( '^[A-Z]\d[A-Z] \d[A-Z]\d$', 'T0A0A0 (CANADA)' );
                     $afcfg_valide_zipcodesel[] = mosHTML::makeOption( '^[1-9][0-9]{3}\s?[a-zA-Z]{2}$', '145 EG (DU)' );
                     $afcfg_valide_zipcodesel[] = mosHTML::makeOption( '^[0-9]{5}$', '05000 (France-Germany)' );
                     $afcfg_valide_zipcodesel[] = mosHTML::makeOption( '^[0-9]{4}$', '5000 (Arg)' );
                     $afcfg_valide_zipcodeview = mosHTML::selectList( $afcfg_valide_zipcodesel, 'afcfg_valide_zipcode', 'class="text_area" size="1"', 'value', 'text', $afcfg_valide_zipcode );
                     echo $afcfg_valide_zipcodeview;
                     ?>
      </td>
      <td align="left" valign="top"><?php echo '&nbsp;';?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_CUSTOMVALIDATION.' 1'; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     echo '<input type="text" size="60" name="afcfg_valide_custom1" class="text_area" value="'.$afcfg_valide_custom1.'">';
                     echo '<div style="margin-top:2px;">'.YAF_CFG_CUSTOMVALIDATIONLEGEND.' : <input type="text" size="50" name="afcfg_valide_custom1_legend" class="text_area" value="'.$afcfg_valide_custom1_legend.'"></div>';
                     ?>
      </td>
      <td rowspan="5" align="left" valign="top"><?php echo YAF_CFG_CUSTOMVALIDATIONDESC;?> </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_CUSTOMVALIDATION.' 2'; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     echo '<input type="text" size="60" name="afcfg_valide_custom2" class="text_area" value="'.$afcfg_valide_custom2.'">';
                     echo '<div style="margin-top:2px;">'.YAF_CFG_CUSTOMVALIDATIONLEGEND.' : <input type="text" size="50" name="afcfg_valide_custom2_legend" class="text_area" value="'.$afcfg_valide_custom2_legend.'"></div>';
                     ?>
      </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_CUSTOMVALIDATION.' 3'; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     echo '<input type="text" size="60" name="afcfg_valide_custom3" class="text_area" value="'.$afcfg_valide_custom3.'">';
                     echo '<div style="margin-top:2px;">'.YAF_CFG_CUSTOMVALIDATIONLEGEND.' : <input type="text" size="50" name="afcfg_valide_custom3_legend" class="text_area" value="'.$afcfg_valide_custom3_legend.'"></div>';
                     ?>
      </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_CUSTOMVALIDATION.' 4'; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     echo '<input type="text" size="60" name="afcfg_valide_custom4" class="text_area" value="'.$afcfg_valide_custom4.'">';
                     echo '<div style="margin-top:2px;">'.YAF_CFG_CUSTOMVALIDATIONLEGEND.' : <input type="text" size="50" name="afcfg_valide_custom4_legend" class="text_area" value="'.$afcfg_valide_custom4_legend.'"></div>';
                     ?>
      </td>
    </tr>
    <tr>
      <td align="left" valign="top" width="300px"><strong> <?php echo YAF_CFG_CUSTOMVALIDATION.' 5'; ?> </strong> </td>
      <td align="left" valign="top"><?php
                     echo '<input type="text" size="60" name="afcfg_valide_custom5" class="text_area" value="'.$afcfg_valide_custom5.'">';
                     echo '<div style="margin-top:2px;">'.YAF_CFG_CUSTOMVALIDATIONLEGEND.' : <input type="text" size="50" name="afcfg_valide_custom5_legend" class="text_area" value="'.$afcfg_valide_custom5_legend.'"></div>';
                     ?>
      </td>
    </tr>
  </table>
  <?php
               $tabs->endTab();
               $tabs->endPane(); ?>
  <input type="hidden" name="compid" value="<?php echo $compid; ?>">
  <input type="hidden" name="option" value="<?php echo $option; ?>">
  <input type="hidden" name="task" value="saveconfig">
  <input type="hidden" name="boxchecked" value="0">
</form>
<?php
     
        
        }


        function showYaForms( &$rows, $search, $pageNav, $option ) {

        global $my, $acl, $database, $mosConfig_offset;
        ?>
<?php
        afLoadSectionTitle( YAF_MENU_FORMS, 'forms48' );
        afLoadHSJS();
        mosCommonHTML::loadOverlib();
        ?>
<form action="index2.php" method="post" name="adminForm">
  <table class="adminheading" border="0" cellpadding="3" cellspacing="0" width="100%">
    <tr>
      <td align="right"><?php echo YAF_MULTI_SEARCHTITLE ?>:
        <input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" />
      </td>
    </tr>
  </table>
  <table width="100%" class="adminlist">
    <tr>
      <th width="20">#</th>
      <th width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th>
      <th align="left"><?php echo YAF_FORM_FORMTITLE; ?></th>
      <th width="20" align="left"><?php echo YAF_FORM_PUBLISHED; ?></th>
      <th width="20" align="center"><?php echo YAF_RFORMS_PREVIEW; ?></th>
      <th width="6%">ID</th>
      <th align="center" width="15%"><?php echo YAF_FORM_DATE;?></th>
      <th width="8%" colspan="2"><?php echo YAF_FORM_ORDER;?></th>
      <th width="1%"><a href="javascript: saveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php YAF_FORM_SAVEORDER;?>" /></a></th>
      <th width="7%"><?php echo YAF_FORM_ACCESS;?></th>
      <th width="12%" align="left"><?php echo YAF_FORM_AUTHOR;?></th>
    </tr>
    <?php
                $i = 0;
		$k = 0;
		$nullDate = $database->getNullDate();
		for($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
			mosMakeHtmlSafe($row);
			
			$img = $row->published ? 'components/com_yaforms/images/success.png' : 'images/publish_x.png';
			$task = $row->published ? 'unpublish' : 'publish';
                        $link = 'index2.php?option=com_yaforms&amp;task=editA&amp;hidemainmenu=1&amp;id='.$row->id;
                        $_Itemid = afGetItemid( $row->id );
                        $linkp = JPATH_SITE.'/index2.php?option=com_yaforms&formid='.$row->id.'&amp;af_mod=1'.($_Itemid ? '&amp;Itemid='.$_Itemid : '&amp;Itemid=99999');

                        $now = _CURRENT_SERVER_TIME;
			if ( $now <= $row->publish_up && $row->published == 1 ) {
			// Published
				$img = 'publish_y.png';
				$alt = YAF_FORM_PUBLISHED;
			} else if ( ( $now <= $row->publish_down || $row->publish_down == $nullDate ) && $row->published == 1 ) {
			// Pending
				$img = 'publish_g.png';
				$alt = YAF_FORM_PENDING;
			} else if ( $now > $row->publish_down && $row->published == 1 ) {
			// Expired
				$img = 'publish_r.png';
				$alt = YAF_FORM_EXPIRED;
			} elseif ( $row->published == 0 ) {
			// Unpublished
				$img = 'publish_x.png';
				$alt = YAF_FORM_DRAFT;
			}
                        // correct times to include server offset info
			$row->publish_up = mosFormatDate( $row->publish_up, _CURRENT_SERVER_TIME_FORMAT );
			if (trim( $row->publish_down ) == $nullDate || trim( $row->publish_down ) == '' || trim( $row->publish_down ) == '-' ) {
				$row->publish_down = YAF_FORM_NEVER;
			}
			$row->publish_down = mosFormatDate( $row->publish_down, _CURRENT_SERVER_TIME_FORMAT );

			$times = '';
			if ($row->publish_up == $nullDate) {
				$times .= '<tr><td>'.YAF_FORM_START.': '.YAF_FORM_ALWAYS.'</td></tr>';
			} else {
				$times .= '<tr><td>'.YAF_FORM_START.': '.$row->publish_up.'</td></tr>';
			}
			if ($row->publish_down == $nullDate || $row->publish_down == 'Never') {
				$times .= '<tr><td>'.YAF_FORM_END.': '.YAF_FORM_NOTEXPIRED.'</td></tr>';
			} else {
				$times .= '<tr><td>'.YAF_FORM_END.': '.$row->publish_down.'</td></tr>';
			}

			if ( $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ) ) {
				if ( $row->created_by_alias ) {
					$author = $row->created_by_alias;
				} else {
					$linkA 	= 'index2.php?option=com_users&task=editA&hidemainmenu=1&id='. $row->created_by;
					$author = '<a href="'. $linkA .'" title="'.YAF_FORM_EDITUSER.'">'. $row->author .'</a>';
				}
			} else {
				if ( $row->created_by_alias ) {
					$author = $row->created_by_alias;
				} else {
					$author = $row->author;
				}
			}
                        $date = mosFormatDate( $row->created, '%x' );
			$access = mosCommonHTML::AccessProcessing( $row, $i );
			$checked = mosCommonHTML::CheckedOutProcessing( $row, $i );
                        //$checked = mosHTML::idBox( $i, $row->id );
                        ?>
    <tr class="row<?php echo $k; ?>">
      <td align="center"><?php echo $pageNav->rowNumber( $i ); ?> </td>
      <td align="center"><?php echo $checked; ?> </td>
      <td align="left"><?php
				if ( $row->checked_out && ( $row->checked_out != $my->id )) {
					echo $row->titel;
				} else {
					?>
        <a href="<?php echo $link; ?>" title="<?php echo YAF_FORM_EDITCONTENTOF.' '.$row->titel; ?>"> <?php echo $row->titel; ?> </a>
        <?php
				}
			   ?>
      </td>
      <td width="20" align="center"><?php
				if ( $times ) {
					?>
        <a href="javascript: void(0);" onMouseOver="return overlib('<table><?php echo $times; ?></table>', CAPTION, '<?php YAF_FORM_PUBLISHINFO;?>', BELOW, RIGHT);" onMouseOut="return nd();" onClick="return listItemTask('cb<?php echo $i;?>','<?php echo $row->published ? "unpublish" : "publish";?>')"> <img src="images/<?php echo $img;?>" border="0" alt="<?php echo $alt; ?>" /> </a>
        <?php
				}
				?>
        </a> </td>
      <td width="20" align="center"><?php echo "<a href=\"".$linkp."\" onclick=\"return hs.htmlExpand(this, { contentId: 'highslide-html', objectType: 'iframe', objectWidth: 700, objectHeight: 900} )\" class=\"highslide\">
                           <img src=\"".JPATH_SITE."/includes/js/ThemeOffice/preview.png\" align=\"middle\" height=\"16\" width=\"16\" border=\"0\" alt=\"".YAF_RFORMS_PREVIEW."\"/>
                           </a>";?> </td>
      <td align="center"><?php echo $row->id; ?> </td>
      <td align="center"><?php echo $date; ?> </td>
      <td align="center"><?php echo $pageNav->orderUpIcon( $i, true, 'orderup' ); ?> </td>
      <td align="center"><input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
      </td>
      <td align="center"><?php echo $pageNav->orderDownIcon( $i, $n, true, 'orderdown' ); ?></td>
      <td align="center"><?php echo $access;?> </td>
      <td align="left"><?php echo $author; ?> </td>
    </tr>
    <?php
		   $k = 1 - $k;
		}
        ?>
  </table>
  <?php
        afLoadHSDivs();
        echo $pageNav->getListFooter();
        ?>
  <input type="hidden" name="option" value="<?php echo $option; ?>" />
  <input type="hidden" name="task" value="" />
  <input type="hidden" name="subtask" value="showaf" />
  <input type="hidden" name="boxchecked" value="0" />
</form>
<?php
        
   }


   function editYaForms( $row, $option, $formid, $items, $lists, $itlists, $params ) {

      global $database, $mosConfig_offset;
      include( JPATH_BASE.'/administrator/components/com_yaforms/config.yaforms.php' );
      
      $tabs = new mosTabs(1);
      mosCommonHTML::loadCalendar();
      mosMakeHtmlSafe( $row, ENT_QUOTES );
     // afLoadFrontEndCSS();
      
      $nullDate = $database->getNullDate();
      $create_date = null;
      if ( $row->created != $nullDate ) $create_date = mosFormatDate( $row->created, '%A, %d %B %Y %H:%M', '0' );
      $mod_date = null;
      if ( $row->modified != $nullDate ) $mod_date = mosFormatDate( $row->modified, '%A, %d %B %Y %H:%M', '0' );
      if ( !$row->hits ) {
         $visibility = "style='display: none; visibility: hidden;'";
      } else {
         $visibility = '';
      }
      ?>
<script type="text/javascript"><!--//<![CDATA[
	     function submitbutton(pressbutton) {

                        var form = document.adminForm;

                        if ( pressbutton == 'menulink' ) {
			      // do field validation
			      if (trim(form.link_name.value) == ""){
				alert( "<?php echo YAF_FORM_CHECKEMPTYMENUNAME; ?>" );
			      } else if (trim(form.menuselect.value) == ""){
				alert( "<?php echo YAF_FORM_CHECKEMPTYMENUSEL; ?>" );
			      } else if (trim(form.link_type.value) == ""){
				alert( "<?php echo YAF_FORM_CHECKEMPTYMENUTYPE; ?>" );
			      } else {
				submitform( pressbutton );
			      }
			}

                        if ( pressbutton == 'afresethits' ) {
			      submitform( pressbutton );
			}

                        if (pressbutton == 'cancel' || pressbutton == 'menu' || pressbutton == 'help') {
			      submitform( pressbutton );
			      return;
			}

			if ( pressbutton == 'save' || pressbutton == 'apply' ) {
			   if (form.titel.value == ""){
				alert( "<?php echo YAF_FORM_CHECKEMPTYFORMTITLE; ?>" );
			   } else if (form.email.value == ""){
				alert( "<?php echo YAF_FORM_CHECKEMPTYFORMMAILTO; ?>" );
			   <?php /*} else if (form.danktext.value == ""){
				alert( "<?php echo YAF_FORM_CHECKEMPTYDANKTEXT; ?>" ); */?>
                           } else {
				<?php getEditorContents( 'editor1', 'text' ) ; ?>
				<?php getEditorContents( 'editor2', 'danktext' ) ; ?>
				submitform( pressbutton );
                           }
                        }
             }
          //]]>--></script>
<form action="index2.php" method="post" name="adminForm" id="adminForm" class="adminform">
<?php
          afLoadSectionTitle( YAF_MENU_FORMS, 'forms48' );
          
          $customjscode = urldecode( $row->customjscode );
          if( get_magic_quotes_gpc()) $customjscode = stripcslashes($customjscode);
          $customjscode = str_replace("<","&lt;",$customjscode);
	  $customjscode = str_replace(">","&gt;",$customjscode);

          $tabs->startPane( 'yaforms' );
          $tabs->startTab( YAF_FORM_TABCONFIG, 'menu1' );
          ?>
<table border="0" cellpadding="3" cellspacing="0" width="900" class="adminform">
  <tr>
    <td valign="top"><table border="0" cellpadding="3" cellspacing="0" width="100%" class="adminform">
        <tr>
          <th width="600" colspan="2" align="left"> <?php echo YAF_FORM_TITLECONFIG; ?> </th>
        </tr>
        <tr>
          <td width="250px"><?php echo YAF_FORM_FORMTITLE; ?>: </td>
          <td><input class="text_area" type="text" size="51" maxlength="100"  style="width:276px" name="titel" value="<?php echo $row->titel; ?>" />
            <?php echo mosToolTip(YAF_HELPER_FCFG_TITLE);?> </td>
        </tr>
        <tr>
          <td width="250px" valign="top"><?php echo YAF_FORM_EMAILS; ?>: </td>
          <td><table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table1">
              <tr>
                <td width="100"><?php echo YAF_FORM_TO ;?>: </td>
                <td><input class="text_area" type="text" size="40" maxlength="100" name="email" value="<?php echo $row->email; ?>" />
                  <?php echo mosToolTip(YAF_HELPER_FCFG_DESTTO);?> </td>
              </tr>
              <tr>
                <td width="100"><?php echo YAF_FORM_CC ;?>: </td>
                <td><input class="text_area" type="text" size="40" name="ccmail" value="<?php echo $row->ccmail; ?>" />
                  <?php echo mosToolTip(YAF_HELPER_FCFG_DESTCC);?> </td>
              </tr>
              <tr>
                <td width="100"><?php echo YAF_FORM_BCC ;?>: </td>
                <td><input class="text_area" type="text" size="40" name="bccmail" value="<?php echo $row->bccmail; ?>" />
                  <?php echo mosToolTip(YAF_HELPER_FCFG_DESTBCC);?> </td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td valign="top" width="250px"><?php echo YAF_FORM_CONFIRMATIONEMAIL; ?>: </td>
          <td><input class="text_area" type="text" size="40" name="params[confirmation_email]" value="<?php echo $params->get( 'confirmation_email' ); ?>" />
            <?php echo mosToolTip(YAF_HELPER_FCFG_CONFIRMATIONEMAIL);?> </td>
        </tr>
        <tr>
          <td valign="top" width="250px"><?php echo YAF_FORM_CAPTCHASYSTEM;?>: </td>
          <td valign="top"><?php echo $lists['seccodeallow'];?> <?php echo mosToolTip(YAF_HELPER_FCFG_CAPTCHA);?> </td>
        </tr>
        <tr>
          <td valign="top" width="250px"><?php echo YAF_FORM_TEXTHTMLSET; ?>: </td>
          <td><?php echo $lists['formopt'];?> <?php echo mosToolTip(YAF_HELPER_FCFG_HTMLMODE);?> </td>
        </tr>
        <tr>
          <td valign="top" width="250px"><?php echo YAF_FORM_EDITORSEL.' (HTML)';?>: </td>
          <td><?php echo $lists['afeditor'];?> <?php echo mosToolTip(YAF_HELPER_FCFG_EDITORSEL);?> </td>
        </tr>
        <tr>
          <td valign="top" width="250px"><?php echo YAF_FORM_EMAILCOPYFIELD; ?>: </td>
          <td><?php echo $lists['emailfieldallow'];?> <?php echo mosToolTip(YAF_HELPER_FCFG_ALLOWSENDCOPY);?> </td>
        </tr>
        <tr>
          <td valign="top"><?php echo YAF_FORM_CUSTOMJSCODE;?>: </td>
          <td><textarea class="text_area" cols="40" rows="4" name="customjscode"><?php echo $customjscode;?></textarea>
            <?php echo mosToolTip(YAF_HELPER_FCFG_CUSTOMJSCODE);?> </td>
        </tr>
        <tr>
          <td valign="top"><?php echo YAF_FORM_CUSTOMCSS;?>: </td>
          <td><textarea class="text_area" cols="40" rows="4" name="customcss" id="afcustomcss">
                            <?php if(isset($row->customcss))echo $row->customcss;?>
                            </textarea>
            <?php echo mosToolTip(YAF_HELPER_FCFG_CUSTOMCSS);?> </td>
        </tr>
        <tr>
          <td valign="top" width="250px"><?php echo YAF_FORM_METADESCRIPTION;?>: </td>
          <td valign="top"><textarea class="text_area" cols="40" rows="1" name="metadesc"><?php echo $row->metadesc;?></textarea>
            <?php echo mosToolTip(YAF_HELPER_FCFG_METADESC);?> </td>
        </tr>
        <tr>
          <td valign="top"><?php echo YAF_FORM_METAKEYWORDS;?>: </td>
          <td valign="top"><textarea class="text_area" cols="40" rows="1" name="metakey"><?php echo $row->metakey;?></textarea>
            <?php echo mosToolTip(YAF_HELPER_FCFG_METAKEY);?></td>
        </tr>
      </table></td>
    <td width="35%" valign="top"><table border="0" cellpadding="3" cellspacing="0" width="100%" class="adminform">
        <tr>
          <th width="400" colspan="3" align="left"> <?php echo YAF_FORM_TITLEPUBLCATION;?> </th>
        </tr>
        <tr>
          <td width="35%" align="left" valign="top"><?php echo YAF_FORM_PUBLISH;?>: </td>
          <td valign="top" align="left"><input type="checkbox" name="published" value="1" <?php echo $row->published ? 'checked="checked"' : ''; ?> />
          </td>
        </tr>
        <tr>
          <td align="left" valign="top"><?php echo YAF_FORM_MENUACCESS;?>: </td>
          <td align="left" valign="top"><?php echo $lists['access']; ?> </td>
        </tr>
        <tr>
          <td align="left" valign="top"><?php echo YAF_FORM_AUTHORALIAS;?>: </td>
          <td align="left" valign="top"><input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php echo $row->created_by_alias; ?>" class="text_area" />
          </td>
        </tr>
        <tr>
          <td><?php echo YAF_FORM_MODCREATEDBY;?>: </td>
          <td><?php echo $lists['created_by']; ?> </td>
        </tr>
        <tr>
          <td><?php echo YAF_FORM_ORDER;?>: </td>
          <td><?php echo $lists['ordering']; ?> </td>
        </tr>
        <tr>
          <td><?php echo YAF_FORM_MODCREATEDDATE;?>: </td>
          <td><input class="text_area" type="text" name="created" id="created" size="25" maxlength="19" value="<?php echo $row->publish_down; ?>" />
            <input name="reset" type="reset" class="button" onclick="return showCalendar('created', 'y-mm-dd');" value="..." />
          </td>
        </tr>
        <tr>
          <td><?php echo YAF_FORM_PUBLISHUP;?>: </td>
          <td><input class="text_area" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php echo $row->publish_up; ?>" />
            <input type="reset" class="button" value="..." onClick="return showCalendar('publish_up', 'y-mm-dd');">
          </td>
        </tr>
        <tr>
          <td><?php echo YAF_FORM_PUBLISHDOWN;?>: </td>
          <td><input class="text_area" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php echo $row->publish_down; ?>" />
            <input type="reset" class="button" value="..." onClick="return showCalendar('publish_down', 'y-mm-dd');">
          </td>
        </tr>
      </table>
      <table border="0" cellpadding="3" cellspacing="0" width="100%" class="adminform">
        <tr>
          <th align="left" colspan="2"> <?php echo YAF_FORM_TITLEPARAMS; ?> </th>
        </tr>
        <tr>
          <td align="right" valign="top" width="60%"><?php echo YAF_FORM_SHOWRESETBTN;?>: </td>
          <td><input name="params[show_reset_button]" id="params[show_reset_button]0" value="0"<?php if($params->get( 'show_reset_button' )!='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_reset_button]0"><?php echo YAF_MULTI_NO;?></label>
            <input name="params[show_reset_button]" id="params[show_reset_button]1" value="1"<?php if($params->get( 'show_reset_button' )=='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_reset_button]1"><?php echo YAF_MULTI_YES;?></label></td>
        </tr>
        <tr>
          <td align="right" valign="top" width="40%"><?php echo YAF_FORM_SHOWBACKBTN;?>: </td>
          <td><input name="params[show_back_button]" id="params[show_back_button]0" value="0"<?php if($params->get( 'show_back_button' )!='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_back_button]0"><?php echo YAF_MULTI_NO;?></label>
            <input name="params[show_back_button]" id="params[show_back_button]1" value="1"<?php if($params->get( 'show_back_button' )=='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_back_button]1"><?php echo YAF_MULTI_YES;?></label></td>
        </tr>
        <tr>
          <td align="right" valign="top" width="40%"><?php echo YAF_FORM_SHOWFORMTITLE;?>: </td>
          <td><input name="params[show_form_title]" id="params[show_form_title]0" value="0"<?php if($params->get( 'show_form_title' )=='0')echo ' checked="checked"';?> type="radio">
            <label for="params[show_form_title]0"><?php echo YAF_MULTI_NO;?></label>
            <input name="params[show_form_title]" id="params[show_form_title]1" value="1"<?php if($params->get( 'show_form_title' )!='0')echo ' checked="checked"';?> type="radio">
            <label for="params[show_form_title]1"><?php echo YAF_MULTI_YES;?></label></td>
        </tr>
        <tr>
          <td align="right" valign="top" width="40%"><?php echo YAF_FORM_DYNAMICPAGETITLES;?>: </td>
          <td><input name="params[change_page_title]" id="params[change_page_title]0" value="0"<?php if($params->get( 'change_page_title' )=='0')echo ' checked="checked"';?> type="radio">
            <label for="params[change_page_title]0"><?php echo YAF_MULTI_NO;?></label>
            <input name="params[change_page_title]" id="params[change_page_title]1" value="1"<?php if($params->get( 'change_page_title' )!='0')echo ' checked="checked"';?> type="radio">
            <label for="params[change_page_title]1"><?php echo YAF_MULTI_YES;?></label></td>
        </tr>
        <tr>
          <td align="right" valign="top" width="40%"><?php echo YAF_FORM_SHOWCREATEDDATE;?>: </td>
          <td><input name="params[show_created_date]" id="params[show_created_date]0" value="0"<?php if($params->get( 'show_created_date' )!='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_created_date]0"><?php echo YAF_MULTI_NO;?></label>
            <input name="params[show_created_date]" id="params[show_created_date]1" value="1"<?php if($params->get( 'show_created_date' )=='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_created_date]1"><?php echo YAF_MULTI_YES;?></label></td>
        </tr>
        <tr>
          <td align="right" valign="top" width="40%"><?php echo YAF_FORM_SHOWMODIFDATE;?>: </td>
          <td><input name="params[show_modif_date]" id="params[show_modif_date]0" value="0"<?php if($params->get( 'show_modif_date' )!='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_modif_date]0"><?php echo YAF_MULTI_NO;?></label>
            <input name="params[show_modif_date]" id="params[show_modif_date]1" value="1"<?php if($params->get( 'show_modif_date' )=='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_modif_date]1"><?php echo YAF_MULTI_YES;?></label></td>
        </tr>
        <tr>
          <td align="right" valign="top" width="40%"><?php echo YAF_FORM_SHOWAUTHOR;?>: </td>
          <td><input name="params[show_author]" id="params[show_author]0" value="0"<?php if($params->get( 'show_author' )!='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_author]0"><?php echo YAF_MULTI_NO;?></label>
            <input name="params[show_author]" id="params[show_author]1" value="1"<?php if($params->get( 'show_author' )=='1')echo ' checked="checked"';?> type="radio">
            <label for="params[show_author]1"><?php echo YAF_MULTI_YES;?></label></td>
        </tr>
        <tr>
          <td align="right" valign="top" width="40%"><?php echo YAF_FORM_USECUSTOMCSS;?>: </td>
          <td><input name="params[use_custom_css]" id="params[use_custom_css]0" value="0"<?php if($params->get( 'use_custom_css' )!='1')echo ' checked="checked"';?> type="radio">
            <label for="params[use_custom_css]0"><?php echo YAF_MULTI_NO;?></label>
            <input name="params[use_custom_css]" id="params[use_custom_css]1" value="1"<?php if($params->get( 'use_custom_css' )=='1')echo ' checked="checked"';?> type="radio">
            <label for="params[use_custom_css]1"><?php echo YAF_MULTI_YES;?></label></td>
        </tr>
        <tr>
          <td align="right" valign="top" width="40%"><?php echo YAF_FORM_USEREDIRECTURL;?>: </td>
          <td><input name="params[use_redirect_url]" id="params[use_redirect_url]0" value="0"<?php if($params->get( 'use_redirect_url' )!='1')echo ' checked="checked"';?> type="radio">
            <label for="params[use_redirect_url]0"><?php echo YAF_MULTI_NO;?></label>
            <input name="params[use_redirect_url]" id="params[use_redirect_url]1" value="1"<?php if($params->get( 'use_redirect_url' )=='1')echo ' checked="checked"';?> type="radio">
            <label for="params[use_redirect_url]1"><?php echo YAF_MULTI_YES;?></label></td>
        </tr>
        <tr>
          <td align="right" valign="top" width="40%"><?php echo YAF_FORM_REDIRECTURL;?>: </td>
          <td><input name="params[redirect_url]" value="<?php echo $params->get( 'redirect_url' );?>" class="text_area" size="" type="text"></td>
        </tr>
      </table>
      <table class="adminform">
        <tr>
          <th align="left" colspan="2"> </th>
        </tr>
        <?php
                   if ( $row->id ) {?>
        <tr>
          <td width="35%" valign="top" align="right"> ID: </td>
          <td><?php echo $formid; ?> </td>
        </tr>
        <tr>
          <td valign="top" align="right"><?php echo YAF_FORM_URLLINK; ?>: </td>
          <td> index.php?option=com_yaforms&formid=<?php echo $formid; ?> </td>
        </tr>
        <?php
                   }?>
        <tr>
          <td  valign="top" align="right"><?php echo YAF_FORM_STATE;?>: </td>
          <td><?php echo $row->published > 0 ? YAF_FORM_PUBLISHED : ($row->published < 0 ? YAF_FORM_ARCHIVED : YAF_FORM_DRAFT);?> </td>
        </tr>
        <tr >
          <td valign="top" align="right"><?php echo YAF_FORM_HITS;?>: </td>
          <td><div <?php echo $visibility; ?>>
              <?php $afhits = $row->hits;
                            echo $afhits;?>
              <input name="afresethits" type="button" class="button" value="<?php echo YAF_FORM_DELHITS;?>" onClick="submitbutton('afresethits');">
            </div></td>
        </tr>
        <tr>
          <td valign="top" align="right"><?php echo YAF_FORM_REV;?>: </td>
          <td><?php
                            if( isset($row->version) ){
                               echo $row->version.' '.YAF_FORM_REVTIMES;
                            } else {
                               echo '-';
                            }
                            ?>
            <input type="hidden" name="version" value="<?php echo $row->version+1;?>" />
          </td>
        </tr>
        <tr>
          <td valign="top" align="right"><?php echo YAF_FORM_CREATED;?>: </td>
          <td><?php
                            if ( !$create_date ) {?>
            <?php echo YAF_FORM_NEWFORM;?>
            <?php
                            } else {
                               echo $create_date;
                            }?>
          </td>
        </tr>
        <tr>
          <td valign="top" align="right"><?php echo YAF_FORM_LASTMOD;?>: </td>
          <td><?php
                            if ( !$mod_date ) {?>
            <?php echo YAF_FORM_NOTMOD;?>
            <?php
                            } else {
                               echo $mod_date;
                               ?>
            <?php
                               echo $row->modifier;
                            }?></td>
        </tr>
      </table></td>
  </tr>
</table>
<?php
          $tabs->endTab();
          $tabs->startTab( YAF_FORM_TABTEXTS, 'menu2' );
          ?>
<table border="0" cellpadding="3" cellspacing="0" width="100%" class="adminform">
  <tr>
    <th align="left"> <?php echo YAF_FORM_TITLETEXTS; ?> </th>
  </tr>
  <tr>
    <td valign="top"><?php echo YAF_FORM_INFTEXT; ?>: </td>
  </tr>
  <tr>
    <td><?php editorArea( 'editor1',  $row->text, 'text', '600', '230', '80', '10' ) ; ?>
    </td>
  </tr>
  <tr>
    <td valign="top"><br />
      <?php echo YAF_FORM_SENDEDTEXT; ?>: </td>
  </tr>
  <tr>
    <td><?php editorArea( 'editor2',  $row->danktext, 'danktext', '600', '230', '80', '10' ) ; ?>
    </td>
  </tr>
</table>
<?php
          $tabs->endTab();
          $tabs->startTab( YAF_FORM_TABATTFILE, 'menu3' );
          ?>
<table class="adminform" border="0" cellpadding="3" cellspacing="0" width="100%">
  <tr>
    <th width="30%" align="left"> <?php echo YAF_FORM_TITLEATTFILE;?> </th>
    <th align="left" colspan="2"></th>
  </tr>
  <tr>
    <td valign="top" ><?php echo YAF_FORM_ALLOWATTFILES;?>: </td>
    <td align="left"><?php echo $lists['formattallow'];?> </td>
  </tr>
  <tr>
    <td valign="top" ><?php echo YAF_FORM_ALLOWATTFILESSIZE;?>: </td>
    <td align="left"><input class="text_area" type="text" size="10" maxlength="100" name="allowattfilesize" style="text-align:right;" value="<?php echo $row->allowattfilesize;?>" />
      Kb <?php echo mosToolTip(YAF_HELPER_ATTF_ALLOWATTFILESSIZE);?> </td>
  </tr>
  <tr>
    <td align="left" valign="top" ><?php echo YAF_FORM_LIMITATT;?>: </td>
    <td><input name="params[limit_attachs]" value="<?php echo $params->get( 'limit_attachs' );?>" class="text_area" size="3" style="text-align:center;" type="text">
      <?php echo mosToolTip(YAF_HELPER_ATTF_LIMITATT);?> </td>
  </tr>
  <tr>
    <td align="left" valign="top" ><?php echo YAF_FORM_SETATTMANDITORY;?>: </td>
    <td><input name="params[set_att_manditory]" id="params[set_att_manditory]0" value="0"<?php if($params->get( 'set_att_manditory' )!='1')echo ' checked="checked"';?> type="radio">
      <label for="params[set_att_manditory]0"><?php echo YAF_MULTI_NO;?></label>
      <input name="params[set_att_manditory]" id="params[set_att_manditory]1" value="1"<?php if($params->get( 'set_att_manditory' )=='1')echo ' checked="checked"';?> type="radio">
      <label for="params[set_att_manditory]1"><?php echo YAF_MULTI_YES;?></label>
      <?php echo mosToolTip(YAF_HELPER_ATTF_SETATTMANDITORY);?> </td>
  </tr>
  <tr>
    <th align="left" colspan="2"> <?php echo YAF_FORM_ALLOWATTFILESSET;?> </th>
  </tr>
  <tr>
    <td align="left" valign="top" colspan="2"><?php
                      afLoadLib ( 'attfiles' );
                      $chkarr = explode( ",", $row->allowattfiles );
                      echo '<table><tr><td valign="top">';
                      afAdmShowAttSelCombo( 'compress', $chkarr );
                      afAdmShowAttSelCombo( 'misc', $chkarr );
                      echo '</td><td valign="top">';
                      afAdmShowAttSelCombo( 'office', $chkarr );
                      afAdmShowAttSelCombo( 'video', $chkarr );
                      echo '</td><td valign="top">';
                      afAdmShowAttSelCombo( 'audio', $chkarr );
                      echo '</td><td valign="top">';
                      afAdmShowAttSelCombo( 'image', $chkarr );
                      afAdmShowAttSelCombo( 'p2p', $chkarr );
                      echo '</td></tr></table>';
                      ?>
    </td>
  </tr>
</table>
<?php
          $tabs->endTab();
          $tabs->startTab( YAF_FORM_TABMENU, 'menu4' );

          afLoadLib( 'loadmenus' );
          
	if ( $formid > 0 ) {
	?>
<table width="100%" class="adminform">
  <tr>
    <th width="600" colspan="2"> <?php echo YAF_FORM_TITLEMENU; ?> </th>
    <th width="300"><?php echo YAF_FORM_MENULINKSTITLE; ?></th>
  </tr>
  <tr>
    <td valign="top" width="130"><?php echo YAF_FORM_MENUINSERTNAME.':'; ?> </td>
    <td><input type="text" name="link_name" class="text_area" value="" size="25" />
    </td>
    <td rowspan="6" valign="top"><?php
		       $and = "\n AND link = 'index.php?option=com_yaforms&formid=".$formid."'";
		       $menusafl = mosAdminMenus::Links2Menu( 'components', $and );
               $menusurl = mosAdminMenus::Links2Menu( 'url', $and );

	               if ( $menusafl != NULL || $menusurl != NULL ) {

                          afmenuLinksSecCat( $menusafl );
                          afmenuLinksSecCat( $menusurl );
                          afmenuLinksSecCatJS();
						 
                          
                       } else {
                       ?>
      <?php echo YAF_FORM_NONE; 
		
                       }
					?></td>
  </tr>
  <tr>
    <td valign="top" width="130"><?php echo YAF_FORM_MENUSELMENU.':'; ?> </td>
    <td><?php echo mosAdminMenus::MenuSelect(); ?> </td>
  </tr>
  <tr>
    <td valign="top" width="130"><?php echo YAF_FORM_MENUTYPE.':'; ?> </td>
    <td><?php
                             $types[] = mosHTML::makeOption( '', YAF_FORM_MENUSELTYPE );
                             $types[] = mosHTML::makeOption( 'components', YAF_FORM_MENUTYPEAFL );
                             $types[] = mosHTML::makeOption( 'url', YAF_FORM_MENUTYPEURL );
                             $lists['link_type'] = mosHTML::selectList( $types, 'link_type', 'class="text_area" size="1"', 'value', 'text' );
                             echo $lists['link_type']; ?>
      <?php echo mosToolTip(YAF_HELPER_MENU_MENUTYPE);?> </td>
  </tr>
  <tr>
    <td valign="top" width="130"><?php echo YAF_FORM_MENUACCESS.':'; ?> </td>
    <td><?php echo afMenuAccess(); ?> </td>
  </tr>
  <tr>
    <td valign="top" width="130"><?php echo YAF_FORM_MENUPUBLISH.':'; ?> </td>
    <td><input type="checkbox" id="link_published" name="link_published" value="1"/>
    </td>
  </tr>
  <tr>
    <td><input type="hidden" name="menufid" value="<?php echo $formid;?>" />
    </td>
    <td><input name="menulink" type="button" class="button" value="<?php echo YAF_FORM_MENUMAKEMENU; ?>" onClick="submitbutton('menulink');" />
    </td>
  </tr>
</table>
<?php
	} else {
					?>
<table class="adminform" width="40%">
  <tr>
    <th>&nbsp; </th>
  </tr>
  <tr>
    <td><br />
      <?php echo YAF_FORM_MENULINKSALERT; ?> <br />
      <br />
      <br />
      <br />
    </td>
  </tr>
</table>
<?php
	}

          $tabs->endTab();
          $tabs->startTab( YAF_FORM_TABFIELDS, 'menu5' );


          if( $afcfg_beitemsinterfase == 'old' ){
             afLoadLib( 'fields' );
          } else {
             afLoadLib( 'fieldsajax' );
          }
          showEditFields( $option, $formid, $items, $itlists, $afcfg_usebehelper, $afcfg_fieldsdefaultlayout );

          
		  $tabs->endTab();
          $tabs->endPane();

   }
	
	
   function showYaFormsInfo() {
   
      afLoadSectionTitle( YAF_MENU_INFO, 'info48' );

      echo ' 
<div class="notes_box"> 
  <p>Молодое, но уже опытное агентство. У нас очень большие амбиции. Следовательно – желание делать работу хорошо и никого не подводить. В числе наших клиентов – крупные предприятия регионального и федерального масштаба. Большинство из них годами пользуются нашим комплексным рекламным сопровождением.</p><p>Мы не беремся за любую работу. Только за ту, с которой сможем справиться. Мы считаем, что в работе и творчестве совершенства не бывает. Что учиться и развиваться можно бесконечно. Познакомьтесь с нашим агентством, с нашими работами.</p> </div> <p>&nbsp;</p> <h2>Важные советы:</h2> <ol> <li><b>Внимайте этим советам.</b> В будущем они помогут вам не совершать ошибки.</li> <li><b>Агентства бывают разными.</b> Именитыми и неизвестными. Это не всегда говорит о качестве работы. В обилии профессиональных терминов и формулировок часто теряется истинный смысл. Каким бы серьезным и убедительным не было коммерческое предложение – главное – портфолио. Оцените его, сравните с портфолио других агентств и, только на основе этого, делайте окончательный выбор. </li> <li><b>Экономьте здраво.</b> Экономия – дело хорошее. Возможно, именно благодаря экономии строится успешный и уверенный бизнес. Экономия должна быть здравой и логичной. Если агентство предлагает вам фирменный стиль за 100 долларов – это не экономия, а шарлатанство. Если у вас есть бизнес, вы должны понимать, что хорошие исполнители стоят денег, а хорошее предприятие должно приносить прибыль. А какой результат вы получите, работая с плохими специалистами и плохим предприятиям? Плохой.</li> </ol> ';

   }
	
}
?>
